﻿using System;
using System.Windows;
using System.Windows.Data;
using SilverlightDebateViewModel.SilverlightDebateWS;

namespace SilverlightDebateView.Classes
{
    public class LoginEnabledConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value != null)
            {
                RIAAuthenticationHeader ria = value as RIAAuthenticationHeader;

                if (ria != null && ria.UserID != -1)
                {
                    return true;
                }
            }
            return false;

        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
